package com.hk.rabbitmq.utils;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;


/**
 * @author: dpb
 * @date: 2022/3/10
 */
public class RabbitMqUtils {
    public static Channel getChannel() throws Exception{

        ConnectionFactory factory = new ConnectionFactory();

        factory.setHost("121.40.45.96");
        factory.setUsername("admin");
        factory.setPassword("123");

        Connection connection = factory.newConnection();
        Channel channel = connection.createChannel();

        return channel;
    }
}
